package com.icexxx.icemock.mock;

import cn.hutool.core.util.RandomUtil;

public class PasswordMock implements IceMock {

	@Override
	public String mock(Integer minVal, Integer maxVal, Integer minWidth, Integer maxWidth, String enums,
			String key) {
		if(minWidth == null) {
			minWidth = 5;
		}
		if(maxWidth == null) {
			maxWidth = 5;
		}
		int width = RandomUtil.randomInt(minWidth, maxWidth + 1);
		StringBuilder sb = new StringBuilder();
		sb.append(RandomUtil.BASE_CHAR);
		sb.append(RandomUtil.BASE_CHAR.toUpperCase());
		sb.append(RandomUtil.BASE_NUMBER);
		sb.append("~!@#$%^&-_+<>?,.");
		String baseStr = sb.toString();
		return RandomUtil.randomString(baseStr, width);
	}

}
